package com.itheima.object1;

import java.util.Scanner;

public class SpringTest01 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("输入一串字符!");
        //初始统计变量.
        int countA = 0;
        int countB = 0;
        int countC = 0;
        int countD = 0;
        String s = sc.nextLine();
        char[] chars = s.toCharArray();
        for (int i = 0; i < chars.length; i++) {
            if (chars[i] >= 'A' && chars[i] <= 'Z') {
                countA++;
            } else if (chars[i] >= 'a' && chars[i] <= 'z') {
                countB++;
            } else if (chars[i] >= '0' && chars[i] <= '9') {
                countC++;
            } else {

            }

        }
        System.out.println("大写字母有" + countA + "个" + "\n" + "小写字母有" + countB + "个" + "\n" + "数字有" + countC + "个" + "\n" + "符号有" + countD + "个");
    }
}
